<template>
  <div class="main">
    <el-popover placement="bottom" trigger="click">
      <ul class="main-list">
        <li
          v-for="item in typeList"
          :key="item.value"
          @click="openLink(item.value)"
        >
          {{ item.label }}
        </li>
      </ul>
      <el-button slot="reference" size="mini" type="primary"> 下载 </el-button>
    </el-popover>
  </div>
</template>

<script>
import widget from '@/mixins/widget'

export default {
  mixins: [widget],

  data() {
    return {
      typeList: [
        {
          label: '省汇总',
          value: 1
        },
        {
          label: '地势汇总',
          value: 2
        },
        {
          label: '清单',
          value: 3
        }
      ]
    }
  },

  methods: {
    openLink(id) {
      let url = this.dataModelData.openUrl + '?'
      for (const key in this.interactParams) {
        url = `${url}${key}=${this.interactParams[key]}&`
      }
      url = `${url}id=${id}`
      window.open(url)
    }
  }
}
</script>

<style lang="scss" scoped>
.main {
  &-list {
    width: 60px;
    list-style: none;
    padding: 0;
    margin: 0;
    li {
      font-size: 12px;
      color: #666666;
      list-style: none;
      padding: 8px 0;
      margin: 0;
      cursor: pointer;
      &:hover {
        color: #409eff;
      }
    }
  }
}
</style>
